package com.free.framework.lib.utils;

import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;

/**
 * @author 李博
 * @date 2016年11月01日
 * @desc
 */
public class AppInfo {

    public static String getVersionCode() {
        try {
            PackageManager manager = ContextHolder.getContext().getPackageManager();
            PackageInfo info = manager.getPackageInfo(ContextHolder.getContext().getPackageName(), 0);
            String version = info.versionName;
            return version;
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
            return "1.0.0";
        }
    }


/*
    public String getWebViewType() {

        if (TextUtils.isEmpty(ua)) {
            return "unknown";
        }
        UserAgent userAgent = UserAgent.parseUserAgentString(ua);
        String type = userAgent.getBrowser().getName();
        if (!TextUtils.isEmpty(type)) {
            return type.replace(" ", "_");
        } else {

            return "unknown";
        }
    }*/

}
